package com.pox.guli.service.edu.controller.api;

import com.pox.guli.common.base.result.R;
import com.pox.guli.service.edu.entity.vo.SubjectVo;
import com.pox.guli.service.edu.service.SubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author PoX21s
 * @Date: 2022/6/5 11:19
 * @Version 1.0
 */

@Slf4j
@Api(description = "学科分类")
//@CrossOrigin
@RestController
@RequestMapping("/api/edu/subject")
public class ApiSubjectController {

    @Resource
    private SubjectService subjectService;

    @ApiOperation("多级数据列表查询")
    @GetMapping("/nested-list")
    public R nestedList() {
        List<SubjectVo> subjectVoList = subjectService.nestedList();

        return R.ok().data("items", subjectVoList);
    }
}
